<?php
namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User as UserModel;
use Illuminate\Support\Facades\Session;

/**
 * Created by PhpStorm.
 * User: hans
 * Date: 15/12/23
 * Time: 下午1:33
 */
class User extends Controller
{
    //用户注册
    public function register(Request $request)
    {
        $r = $request->all();
        if ($r) {
            $user = UserModel::updateOrCreate(['mobile'=>$r['mobile']], [
                'mobile' => $r['mobile'],
                'name' => $r['name'],
                'email' => $r['email']
            ]);
        }

        $mobile = Session::get('mobile');

        return view('common.register', [
            'mobile'=>$mobile
        ]);
    }
}